package com.example.smartcity1.network;

import com.example.smartcity1.bean.BannerBean;
import com.example.smartcity1.bean.MyFeedbackPostBean;
import com.example.smartcity1.bean.MyLoginBean;
import com.example.smartcity1.bean.MyLoginPostBean;
import com.example.smartcity1.bean.MsgCodeBean;
import com.example.smartcity1.bean.MyOrderBean;
import com.example.smartcity1.bean.MyPasswordPutBean;
import com.example.smartcity1.bean.MyRegisterPostBean;
import com.example.smartcity1.bean.MyUpDataPostBean;
import com.example.smartcity1.bean.MyUserInfoBean;
import com.example.smartcity1.bean.NewsBean;
import com.example.smartcity1.bean.NewsCommentsBean;
import com.example.smartcity1.bean.NewsTypeBean;
import com.example.smartcity1.bean.ServiceBean;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Query;

public interface AppService {
    //获取轮播图数据
    @GET("/userinfo/rotation/list?pageNum=1&pageSize=10&type=45")
    Call<BannerBean> getBannerData();

    //获取推荐服务数据
    @GET("/service/service/list?pageNum=1&pageSize=10")
    Call<ServiceBean> getServiceData();

    //获取专题新闻数据
    @GET("/press/press/list?pageNum=1&pageSize=10&pressCategory=48")
    Call<NewsBean> getNewsTopicData();

    //获取新闻类型数据
    @GET("/system/dict/data/type/press_category")
    Call<NewsTypeBean> getNewsTypeData();

    //获取新闻列表
    @GET("/press/press/list?pageNum=1&pageSize=10")
    Call<NewsBean> getNewsHomeData(@Query("pressCategory") int type);

    //获取评论列表
    @GET("/press/comments/list?pageNum=1&pageSize=10")
    Call<NewsCommentsBean> getNewsCommentsData(@Query("pressId") int pressId);

    //新增评论

    //登录
    @POST("/login")
    Call<MyLoginBean> getMyLoginData(@Body MyLoginPostBean myLoginPostBean);

    //注册
    @POST("/system/user/register")
    Call<MsgCodeBean> getMyRegisterData(@Body MyRegisterPostBean myRegisterPostBean);

    //用户详细信息
    @GET("/getInfo")
    Call<MyUserInfoBean> getMyUserInfoData(@Header("Authorization") String token);

    //修改用户信息
    @POST("/system/user/updata")
    Call<MsgCodeBean> getMyUSerUpData(@Header("Authorization") String token, @Body MyUpDataPostBean myUpDataPostBean);

    //用户订单
//    @GET("/userinfo/orders/list")
//    Call<MyOrderBean> getMyOrderData(@Header("Authorization") String token, @Query("userId") String userId);
    @GET("/userinfo/orders/list")
    Call<MyOrderBean> getMyOrderData(@Header("Authorization") String token);

    //修改密码
    @PUT("/system/user/resetPwd")
    Call<MsgCodeBean> getMyPasswordData(@Header("Authorization") String token, @Body MyPasswordPutBean myPasswordPutBean);

    //意见反馈
    @POST("/userinfo/feedback")
    Call<MsgCodeBean> getMyFeedbackData(@Header("Authorization") String token, @Body MyFeedbackPostBean myFeedbackPostBean);
}
